#include<bits/stdc++.h>
using namespace std;
long long  h, m, s, num;
int main()
{
	cin >> num;
	h = num/3600000;
	num-=h*3600000;
	h %= 24;
	m = num/(1000*60);
	num -= m*60000;
	s=num/1000;
	printf("%02d:%02d:%02d", h, m, s);
	return 0;
}